

<style>
body {
  min-width:357px;
  overflow-x:hidden;
}

img {
  margin:5px;
  border:2px solid black;
  vertical-align:middle;
  width:400px;
  height:400px;
}
</style>

<script>
var currentUrl;
chrome.tabs.getSelected(null, function(tab) {

	var query =	"http://api.bit.ly/v3/shorten?" + 
	"login=pablito900&" + 
	"apiKey=R_3e2d65b471be2dcf824f1165b97b16af&" +
	"longUrl=" + tab.url + "&" +
	"format=txt";
	
	var req = new XMLHttpRequest();
	  
	req.open("GET",	query, true);
	
		
	req.onload = load;
	req.send(null);

	function load() {

		var url = req.responseText + ".qrcode";
		var img = document.createElement("image");
		img.src = url;
		//img.width = "100%";
		//img.height = "100%";
		document.body.appendChild(img);
		document.write(query);
		// document.write(url);
	}

      });

	
</script>